import React from 'react';
import {RouteComponentProps} from 'react-router';
type Props = RouteComponentProps&{}
export default class extends React.Component<Props>{
  render(){
    // this.props.history是抽象出来的history对象 并不是原生的history对象 内部可能是hash实现的 也可能是window.history实现的
    // console.log(this.props.history === window.history);

    console.log(this.props.history.location === this.props.location); //true

    console.log(this.props);
    /*
            history:
                action: "POP"
                block: ƒ block(prompt)
                createHref: ƒ createHref(location)
                go: ƒ go(n)
                goBack: ƒ goBack()
                goForward: ƒ goForward()
                length: 4
                listen: ƒ listen(listener)
                location: {pathname: "/", search: "", hash: "", state: undefined}
                push: ƒ push(path, state)
                replace: ƒ replace(path, state)
                __proto__: Object
            location:
                hash: ""
                pathname: "/"
                search: ""
                state: undefined
                __proto__: Object
            match:
                isExact: true
                params: {}
                path: "/"
                url: "/"
                __proto__: Object
            staticContext: undefined //←服务端渲染时用到
            __proto__: Object
        */

    return (
      <div>Home</div>
    )
  }
}
